#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int removeElement(int* nums, int numsSize, int val)
{
    int i = 0;
    while (i < numsSize)
    {
        if (nums[i] == val)
        {
            for (int k = i; k < numsSize - 1; k++)
            {
                nums[k] = nums[k + 1];
            }
            numsSize--;
        }
        else
        {
            i++;
        }
    }
    return numsSize;
}

int main()
{
	int nums[] = { 3,2,2,3 };
	int numsSize = 4;
	int val = 3;

	removeElement(nums, numsSize, val);
	for (int i = 0; i < numsSize; i++)
		{
			printf("%d ", nums[i]);
		}
	return 0;
}